package com.thoughtworks;

public class CheckOutBookAction implements Action {

    public void doAction(ActionParams actionParams)
    {
        actionParams.output.displayMessage("Enter the name of the book");
        String name=actionParams.input.getString();
        boolean result=actionParams.library.checkOutBook(actionParams.libraryNumber,name);
        String message;
        if(result)
            message="Thank you! Enjoy the book";
        else
            message="That book is not available.";
        actionParams.output.displayMessage(message);

    }

}
